import turtle

turtle.hideturtle()
diretion = turtle.textinput("请输入绘画方向", "朝左绘画（L）或者朝右绘画（R）？")

if diretion.upper() == "L":
    shapn = turtle.textinput("输入正n边形", "绘制等边三角形（3）或者正方形（4）？")

    if shapn == "3":
        turtle.write("绘制等边三角形。", font=("宋体", 14, "bold"))
    elif shapn == "4":
        turtle.write("绘制正方形。", font=("宋体", 14, "bold"))
    else:
        turtle.write("输入数字不合法， 请输入3或4。", font=("宋体", 14, "bold"))

elif diretion.upper() == "R":
    shapn = turtle.textinput("输入正n边形", "正五边形（5）或正六边形（6）？")

    if shapn == "5":
        turtle.write("绘制正五边形。", font=("宋体", 14, "bold"))
    elif shapn == "6":
        turtle.write("绘制正六边形。", font=("宋体", 14, "bold"))
    else:
        turtle.write("输入数字不合法， 请输入3或4。", font=("宋体", 14, "bold"))

else:
    turtle.write("输入方向不合法， 请输入L或R。", font=("宋体", 14, "bold"))